﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="Service.aspx.cs" Inherits="MockPrjTeam2.Pages.Views.Service" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function Confirm_Active() {
            return confirm('Do you want to make this Service active ?');
        }
    </script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel runat="server" ID="upnlInActive">
                    <ContentTemplate>
    <table style="width: 100%">
        <tr>
            <td>
                <asp:LinkButton ID="lbtnAll" runat="server" CommandName="all" OnCommand="StartWithByNames">All</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtn09" runat="server" CommandName="0-9" OnCommand="StartWithByNames">0-9</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtnAE" runat="server" CommandName="a-e" OnCommand="StartWithByNames">A B C D E</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtnFJ" runat="server" CommandName="f-j" OnCommand="StartWithByNames">F G H I J</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtnKN" runat="server" CommandName="k-n" OnCommand="StartWithByNames">K L M N</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtnOR" runat="server" CommandName="o-r" OnCommand="StartWithByNames">O P Q R</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtnSV" runat="server" CommandName="s-v" OnCommand="StartWithByNames">S T U V</asp:LinkButton>
                &nbsp;|
                <asp:LinkButton ID="lbtnWZ" runat="server" CommandName="w-z" OnCommand="StartWithByNames">W X Y Z</asp:LinkButton>
                &nbsp;|
            </td>
            <td>
                <asp:Button ID="btnCopyService" runat="server" Text="Copy" />
            </td>
            <td>
                <asp:Button ID="btnCreateService" runat="server" Text="Create" OnClick="btnCreateService_Click" />
            </td>
            <td>
                
                        <asp:CheckBox ID="chkInActive" runat="server" AutoPostBack="True" Text="Include In-active"
                            OnCheckedChanged="chkInActive_CheckedChanged" />
                    
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:GridView ID="grvService" runat="server" AutoGenerateColumns="False" CssClass="grvService"
                    Width="710px" AllowPaging="True" OnPageIndexChanging="grvService_PageIndexChanging"
                    PageIndex="1" EmptyDataText="There are no items to show">
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <input name="rdoService" id="rdoService" type="radio" value='<%# Eval("ServiceID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Service Name">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtnServiceName" CausesValidation="false" runat="server" CommandName='<%# Eval("ServiceID") %>'
                                    CommandArgument='<%#Eval("IsActive") %>' OnClientClick='<%# !(bool)Eval("IsActive") ? "return Confirm_Active();" : string.Empty %>'
                                    OnCommand="LbtnServiceNameClick"><%# Eval("ServiceName")%></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Description" DataField="ServiceShortDescription" />
                        <asp:BoundField HeaderText="Service Type" DataField="ServiceType" />
                        <asp:BoundField HeaderText="Contact" DataField="ContactName" />
                        <asp:TemplateField HeaderText="Is Active?">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%#(bool) Eval("IsActive") ? "Yes" :"No" %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataRowStyle BorderColor="Red" BorderStyle="Dotted" />
                </asp:GridView>
            </td>
        </tr>
    </table>
    </ContentTemplate>
                </asp:UpdatePanel>
</asp:Content>
